/*
 * tinteger.h
 *
 *  Created on: Jan 24, 2016
 *      Author: root
 */

#ifndef FUNNY_SCHEME_INTEGER_H
#define FUNNY_SCHEME_INTEGER_H

#include "../ds/datastructure.h"

DEFINE_OPERATOR( make_integer     );
DEFINE_OPERATOR( quotient         );
DEFINE_OPERATOR( rem              );
DEFINE_OPERATOR( mod              );
INIT_OPERATORS( integer );

Cell* make_integer(Scheme *sc, long num);

int divide_exactly(Cell* x, Cell* y);
Cell* int_add(Scheme *sc, Cell* x, Cell* y);
Cell* int_mul(Scheme *sc, Cell* x, Cell* y);
Cell* int_sub(Scheme *sc, Cell* x, Cell* y);
Cell* int_div(Scheme *sc, Cell* x, Cell* y);

Cell* int_to_fraction(Scheme *sc, Cell* x);
Cell* int_to_decimal(Scheme *sc, Cell* x);

#endif //FUNNY_SCHEME_INTEGER_H
